<script>
$(function(){
    $('#form').submit(function(){
        $.post(location.href,$(this).serialize(),function(data){
            alert(data.message);
            location.href = location.href;
        },'json');
        return false;
    });
});
</script>
<div class="edit_tab tab">
<div class="bg1">
<div class="bg2">
      <span class="span_now">设置<font color='red'><?php echo $this->username; ?></font>的权限</span>
</div>
</div>
</div>
<div class="edit_div">
<div class="line_1"></div>
<form id="form">
<?php foreach($this->nodes as $menu_name=>$node): ?>
    <div class="form_div1">
        <span class="span1"><?php echo !$menu_name ? '未分配的' : $menu_name; ?>：</span>
        <span>
            <?php foreach($node as $node_detail): ?>
                <input type="checkbox" name="node_ids[]" <?php echo $node_detail['checked']; ?> value="<?php echo $node_detail['node_id']; ?>" /><?php echo $node_detail['name']; ?>
            <?php endforeach; ?>
        </span>
    </div>
<?php endforeach; ?>
<div class="form_div1">
       <span class="span1"></span>
       <span><input name="" type="submit" class="btn1" value="确定" /><input name="" type="reset" class="btn1" value="重置" /></span>
</div>
</form>
</div>